#############################################################
####### Summary Statistics of the Dependent Variables  ####
#################       Appendix (C1-C2)        #############
###############      October 10, 2018     ##################
#########  Checked December 16, 2022 ###############


rm(list=ls())
library(foreign)
library(plyr)
library(stargazer)
library(ggplot2)


data=read.csv("~/Dropbox/Personal Research 2017/replications/karn_nov16.csv")
names(data)
summary(data$Latitude)
summary(data$Longitude)
summary(data$border1)
summary(data$border2)
summary(data$Slope)


#######################
##### Distances #####

#Distance to Mysore-Bombay Border
rd10.mb=data[which(data$NEAR_DIST_border1<10000),] #20 km


table(rd10.mb$border1)

#Distance to Hyderabad-Bombay Border
rd10.hb=data[which(data$NEAR_DIST_border2<10000),] #20 km

table(rd10.hb$border2)


##########################################
##### Tables B1-B2 Descriptive Stats ########
####### Dependent Variable ############

#baseline bandwidth (20km)
#summary of the dependent variable

#Mys-Bom
dv1=as.data.frame(cbind(rd10.mb$health_binary,
                       rd10.mb$pucca_binary))
colnames(dv1)=c("Health Centers", 
               "Paved Roads")
summary(dv1)
stargazer(dv1)


#Hyd-Bom
dv2=as.data.frame(cbind(rd10.hb$health_binary,
                       rd10.hb$pucca_binary))
colnames(dv2)=c("Health Centers", 
               "Paved Roads")
summary(dv2)
stargazer(dv2)



